package com.zx.pm.mapper;

import com.zx.pm.domain.CostCategoryDict;
import com.zx.pm.domain.Project;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Optional;

@Mapper
public interface BidMapper {
    List<Project>selectBidList(Project project);


    boolean checkUnitNameUnique(Project project);

    boolean checkUnitprojectNoUnique(Project project);

    int insertBid(Project project);

    @Select("SELECT * FROM project WHERE id = #{id}")
    Optional<Project> findById(@Param("id") Long id);

//    @Update("UPDATE project SET archive_status = #{archiveStatus}, archive_time = #{archiveTime}, archive_reason = #{archiveReason} WHERE id = #{id}")
//    void save(@Param("id") Long id,
//              @Param("archiveStatus") Integer archiveStatus,
//              @Param("archiveTime") Date archiveTime,
//              @Param("archiveReason") String archiveReason);


    void updateProjectArchiveInfo(Project project);


//    Project selectBidById(Long id);

    int updateBid(Project project);

    @Select("SELECT * FROM project WHERE id = #{id}")
    Project selectBidById(Long id);

    int countBySex(int i);

    @Select("SELECT code, name FROM cost_category_dict WHERE status = '1' ORDER BY sort")
    List<CostCategoryDict> selectEnabled();


}

